package com.vincent.dao;

import com.vincent.model.Admin;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;

/**
 * Created by vincent on 15-1-2.
 */
@Repository("adminDao")
public class AdminDao {
    @Resource
    private AdminMapper adminMapper;

    public Admin findByUserName(String userName){
        return adminMapper.selectByUserName(userName);
    }

    public void update(Admin admin){
        adminMapper.updateByPrimaryKeySelective(admin);
    }

    public Admin selectByUserNameAndPwd(String userName,String pwd){
        return adminMapper.selectByUserNameAndPwd(userName,pwd);
    }
}